<!--{template header}-->
<!--contain start-->
<div class="wrapper">
<div class="body_container">
    <div class="container_24">
        <!--{template user/user_nav}-->
		<!--main start-->
        <section class="clearfix section">
            <!--{template user/user_side}-->
            <div class="show_panel container_24 po_re">
                <div class="prefix_3 grid_21">
                    <div class="panel clearfix box">
                        <!--main content-->
                        <div class="">
                            <!--header内容头部 start-->
                            <header class="clearfix box_header">
                                <h2 class="grid_4 alpha omega box_title t_c">{if $op=='inbox'}{$_lang['inbox']}{else}{$_lang['outbox']}{/if}</h2>
                                <div class="grid_17 alpha omega">
                                    <nav class="box_nav">
                                        <ul>
                                            <li {if $msg_type =='system'}  class="selectedLava" {/if}>
                                                <a href="index.php?do=$do&view=$view&op=inbox&msg_type=system" original-title="{$_lang['system_msg']}">{$_lang['system_msg']}({$count_system})</a>
                                            </li>
											 <li {if $msg_type=='accept'}  class="selectedLava" {/if}>
                                                <a href="index.php?do=$do&view=$view&op=inbox&msg_type=accept" original-title="{$_lang['private_message']}">{$_lang['private_message']}({$count_accept})</a>
                                            </li>
											 <li {if $msg_type=='output'}  class="selectedLava" {/if}>
                                                <a href="index.php?do=$do&view=$view&op=output&msg_type=output" original-title="{$_lang['private_message']}">{$_lang['sms_has_been_sent']}({$count_output})</a>
                                            </li>
											 <li {if $msg_type=='write'}  class="selectedLava" {/if}>
                                                <a href="index.php?do=$do&view=$view&op=send&msg_type=write" original-title="{$_lang['private_message']}">{$_lang['write_message']}</a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                                <div class="clear">
                                </div>
                            </header>
                            <!--header内容头部 end-->
                            <div class="data_list mar10" style="margin-bottom:0;">
                                <form method="post" id="frm_msg" action="index.php?do={$do}&view={$view}&msg_type={$msg_type}">
                                	<input type="hidden" name="op" value="{$op}" id="op">
                                    <table class="data_table">
                                        <thead>
                                            <tr>
                                                <th scope="col">
                                                  {if $msg_type!='output'}{$_lang['status']}{/if}
                                                </th>
                                                <th scope="col" colspan="3" width="250">
                                                    {$_lang['title']}
                                                </th>
                                                <th scope="col">
                                                    {if $msg_type=='output'}{$_lang['send']}{else}{$_lang['to_user']}{/if}
                                                </th>
                                                <th scope="col">
                                                    {$_lang['time']}
                                                </th>
                                                <th scope="col" colspan="1" width="120">
                                                    {$_lang['operate']}
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	{if $data}
                                            {loop $data $k $v}
											
                                            <tr class="odd">
                                                <td>
                                                    <input type="checkbox" value="$v['msg_id']" id="cbk_selected" name="ckb[]">
													{if $msg_type!='output'}
                                                   		 {if $uid==$v['to_uid']&&!$v['view_status']}{$_lang['unread']}{else}{$_lang['already_read']}{/if}
												    {/if}
                                                </td>
                                                <td colspan="3">
                                                	<!--{eval if($v['uid']){$type='inbox';}else{$type="system";}}-->
                                                    <a {if $v['view_status']!=1&&$msg_type!='output'}style="font-weight: bold"{/if} title="$v['title']"
 href="index.php?do=$do&view=$view&op=views&ac=view&msg_id=$v['msg_id']&msg_type=$msg_type">
$v['title'] </a>
                                                </td>
                                                <td>
                                                	{if $msg_type!='output'}
                                                		{if !$v['username']}{$_lang['system_msg']}{else}{$v['username']}{/if}
													{else}
														$v['to_username']
													{/if}
                                                </td>
                                                <td>
                                                    <!--{date('Y-m-d',$v['on_time'])}-->
                                                </td>
                                                <td colspan="1">
                                                    <a class="button" href="index.php?do=$do&view=$view&op=views&ac=view&msg_id=$v['msg_id']&msg_type=$msg_type"><span class="book icon"></span>{$_lang['view']}</a>
													<a class="button" href="index.php?do=$do&view=$view&op=del&msg_id=$v['msg_id']&page=$page&msg_type=$msg_type"
													 onclick="return del(this);"><span class="trash icon"></span>{$_lang['delete']}</a>
                                                </td>
                                            </tr>
                                            {/loop}
										
                                        </tbody>
                                    <tfoot>
                                      <tr>
                                         <td colspan="7">
                                       	<div class="clearfix pad10">   
											<a href="javascript:;" value="0" id="checkbox" onclick="checkall(this.id)">{$_lang['select_all']}</a>
                                      	 	<button onclick="return mulit_del();" value="{$_lang['delete_selected']}" type="button" name="sbt_action"><span class="icon trash"></span>{$_lang['delete_selected']}</button>
											{if $msg_type!='output'}
												<button onclick="return mulit_views();" value="{$_lang['biao_already']}" type="button"  name="sbt_action"><span class="icon hand-1"></span>{$_lang['biao_already']}</button>
											{/if}
										</div>
                                        </td>
                                  </tr> 
                               </tfoot>
							   	{else}
									<tr>	
										<td colspan="8" class="t_c">
										{$_lang['norecord']}
										</td> 
									</tr>
								{/if}
                           </table>
                         </form>
                       </div>
                     <div class="page">{$pages['page']}<div class="clear"></div></div>
                   </div>
                 <!--main content end -->
              <div class="clear"></div>
           </div>
         </div>
       </section>
      <!--main end-->
    </div>
  </div>
  <!--contain end-->
  <script type="text/javascript">
  function del(obj){
		var url = obj.href;
		showDialog("{$_lang['confirm_delete']}",'confirm',"{$_lang['operate_notice']}","formSub('"+url+"','url',false);");return false;		
	}
	
	function mulit_del(){
		$("#op").val("mulit_del");
		showDialog("{$_lang['confirm_delete']}",'confirm',"{$_lang['operate_notice']}","formSub('frm_msg','form',false);");return false;
	}
	
	function mulit_views(){
		$("#op").val("mulit_views");
		formSub('frm_msg','form',false);return false;
	}
   </script>
   <!--{template user/user_footer}-->
   <!--{template footer}-->